home *** CD-ROM | disk | FTP | other *** search
/ Aminet 6 / Aminet 6 - June 1995.iso / Aminet / misc / amag / AM94122.lha / Shells / bsh / fact < prev    next >
Encoding:
Text File  |  1994-11-19  |  415 b   |  14 lines

  1. if argv[1]>1
  2.     return argv[1]*fact(argv[1]-1)
  3. else
  4.     return 1
  5. endif
  6. # fact - recursive calculation of factorial function.  To run, type:
  7. #    eval fact(6)
  8. # or some other number.
  9. #
  10. # Fact is presented as is; no warrantee is either expressed or implied
  11. # as to it's suitability to any purpose whatsoever.  You assume all the
  12. # risk for all damage, even if caused by a defect in the software,
  13. # no matter how awful.
  14.